<script setup lang="ts">
import { reactive, ref } from 'vue'
import { useRouter } from 'vue-router'

const router = useRouter()
const form = reactive({
  username: "18388220715",
  password: "111111",
})

//登录处理
const onSubmit = async () => {
  console.log(form)
  localStorage.setItem('token', 'dummy-token')
  router.push('/')
}

</script>

<template>
  <div class="min-h-screen flex flex-col">
    <!-- 顶部栏 -->
    <header class="fixed top-0 left-0 right-0 h-15 bg-white shadow z-1000">
      <div class="bg-#409EFF max-w-1200px m-auto h-full flex justify-center items-center px-5">
        <h1 class="text-white">欢迎登录饿了么</h1>
      </div>
    </header>

    <!-- 主内容区域 -->
    <main class="flex-1 mt-15 mb-15 overflow-y-auto">
      <div class="min-h-[calc(100vh-120px)] bg-gray-100">
        <div class="p-6 w-full max-w-none m-0">
          <el-form :model="form" label-width="auto" style="max-width: 600px">
            <el-form-item label="用户名">
              <el-input v-model="form.username" />
            </el-form-item>
            <el-form-item label="密码">
              <el-input v-model="form.password" type="password" />
            </el-form-item>

            <el-form-item>
              <div class="flex gap-4 w-full">
                <el-button type="primary" @click="onSubmit" class="w-full h-11 text-base">登录</el-button>
                <el-button type="Default" @click="onSubmit" class="w-full h-11 text-base">去注册</el-button>
              </div>
            </el-form-item>
          </el-form>
        </div>
      </div>
    </main>
    <div></div>
  </div>
</template>
